package org.benjamin.lending.service;

import java.math.BigDecimal;
import java.util.Map;

import org.benjamin.lending.domain.entity.TransactRequest;
import org.benjamin.lending.domain.form.RealNameForm;
import org.benjamin.lending.domain.form.RechargeForm;
import org.benjamin.lending.domain.form.TransactForm;
import org.benjamin.lending.domain.form.WithdrawForm;
import org.benjamin.lending.domain.transact.BasicOutBean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

public interface TransactService {
	
	/**
	 * 实名认证
	 * @param realNameForm 提交表单
	 * @return 返回BasicOutBean对象让AOP捕捉
	 */
	BasicOutBean realNameRequest(String username,RealNameForm realNameForm);
	
	/**
	 * 实名认证返回
	 * @param responseMap
	 * @return
	 */
	TransactRequest realNameResponse(Map<String,Object> responseMap);
	
	TransactRequest realNameResponse(Map<String,Object> responseMap,String requestId);
	
	BasicOutBean registerAccessRequest(String username);

	TransactRequest registerAccountResponse(TransactRequest transactRequest, Map<String, Object> responseMap);
	
	BasicOutBean userRechargeRequest(RechargeForm rechargeForm,String username);
	
	void userRechargeResponse(Integer rechargeId,boolean finshSuccess,Map<String,Object> responesMap);
	
	TransactRequest userRechargeResponse(TransactRequest transactRequest,Map<String,Object> responseMap);
	/**
	 * 请求用户提现接口
	 * @param username 用户名
	 * @param withdrawFrom 提现表单
	 * @param serviceCharge 提现手续费
	 * @return 返回对象
	 */
	BasicOutBean withdrawRequest(String username,WithdrawForm withdrawFrom,BigDecimal serviceCharge);
	
	TransactRequest withdrawResponse(TransactRequest request,Map<String,Object> responseMap);

	Page<TransactRequest> findRequestLogsPage(TransactForm transactForm, Pageable pageable);

	TransactRequest findRequestDetails(String requestId);

	String signature(Map<String, Object> responseMap, String... signatureKeyArray);

	boolean checkTheSignature(Map<String,Object> responseMap, String... strings);

	


}
